﻿namespace com.vs.DataAccess
{
    using com.vs.General;
    using System;
    using System.IO;
    using System.Xml.Serialization;

    public class ObjHelper
    {
        public object initDS(Session sess, string stDS, Type type, ref string stError)
        {
            XmlSerializer serializer = null;
            object obj2;
            try
            {
                serializer = new XmlSerializer(type);
                using (StringReader reader = new StringReader(stDS))
                {
                    obj2 = serializer.Deserialize(reader);
                }
            }
            catch (Exception exception)
            {
                ExceptionManager.LogException(sess, exception);
                stError = "MSG_GEN000";
                obj2 = null;
            }
            return obj2;
        }
    }
}

